package com.lhd.action.mediator;

/**
 * @Author: liuhd
 * @Date: 2024/12/18 21:40
 * @Description:
 */
public class Client {
    public static void main(String[] args) {
        Mediator mediator = new ConcreteMediator();

        ColleagueA colleagueA = new ColleagueA();
        colleagueA.setName("A");
        colleagueA.setMediator(mediator);


        ColleagueB colleagueB = new ColleagueB();
        colleagueB.setName("B");
        colleagueB.setMediator(mediator);

        mediator.register(colleagueA);
        mediator.register(colleagueB);

        colleagueA.ASelfMethod();
        colleagueA.invokeAdjust();

        colleagueB.BSelfMethod();
        colleagueB.invokeAdjust();
    }
}
